Skip to content

Add Microsoft Defender for DevOps workflow#600

Merged
cute-omega merged 3 commits into
masterfrom
cute-omega-patch-1
Apr 19, 2026
Merged

Add Microsoft Defender for DevOps workflow#600
cute-omega merged 3 commits into
masterfrom
cute-omega-patch-1

Conversation

@cute-omega

Copy link
Copy Markdown
Collaborator

This workflow integrates Microsoft Security DevOps for static analysis.

Ⅰ. 描述此PR的作用:

Ⅱ. 此PR修复了哪个issue吗?

Ⅲ. 界面变化截屏

This workflow integrates Microsoft Security DevOps for static analysis.
Copilot AI review requested due to automatic review settings April 18, 2026 14:17
Comment thread .github/workflows/defender-for-devops.yml Fixed
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to run Microsoft Security DevOps (MSDO) static analysis and publish results to GitHub’s Security tab via SARIF upload.

Changes:

  • Introduces a new defender-for-devops.yml workflow triggered on pushes/PRs to master and on a weekly schedule.
  • Runs microsoft/security-devops-action and uploads generated SARIF to GitHub code scanning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/defender-for-devops.yml
Comment thread .github/workflows/defender-for-devops.yml
Comment thread .github/workflows/defender-for-devops.yml
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

5 similar comments
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@cute-omega

Copy link
Copy Markdown
Collaborator Author

@copilot 这一份PR里使用Microsoft Security DevOps是干什么的?

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

@copilot 这一份PR里使用Microsoft Security DevOps是干什么的?

这个 PR 引入了 Microsoft Security DevOps (MSDO) 工作流,主要用于静态代码分析和安全扫描。具体来说,它做以下几件事:

  1. 运行静态分析工具microsoft/security-devops-action 会自动安装并运行多种安全扫描工具(如反恶意软件扫描、依赖项漏洞检测、配置错误检查等),分析仓库中的代码。

  2. 上传扫描结果:扫描完成后,结果会以 SARIF 格式上传到 GitHub 的 Security 标签页,方便在 GitHub 界面上直接查看安全问题和警告。

  3. 持续检测:工作流会在每次推送到 master 分支、每个 PR 以及每周定期自动运行,确保代码安全问题能被及时发现。

简而言之,这是为项目添加的一层自动化安全检查,帮助发现代码中潜在的安全漏洞。

@cute-omega

Copy link
Copy Markdown
Collaborator Author

@copilot 我还需要什么手动配置吗?还是说可以直接合并?

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

@copilot 我还需要什么手动配置吗?还是说可以直接合并?

取决于你的目标:

如果只需要在 GitHub Security 标签页查看扫描结果,可以直接合并,无需额外配置——工作流本身已包含所需权限(security-events: write)。

如果需要将数据上报到 Microsoft Defender for Cloud(Azure),则合并前需要手动完成以下配置:

  1. 在 Azure 中将 GitHub 组织与 Microsoft Defender for Cloud 集成
  2. 授予相应权限

详见官方文档:https://learn.microsoft.com/en-us/azure/defender-for-cloud/quickstart-onboard-github

如果只是想做基础的代码安全扫描,直接合并即可。

@cute-omega cute-omega merged commit 006c35b into master Apr 19, 2026
10 of 13 checks passed
@cute-omega cute-omega deleted the cute-omega-patch-1 branch April 19, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants